﻿using PSE.Deployment.SetupBase.Configuration;

namespace PSE.Deployment.ConfigurationManager.Controls
{
	/// <summary>
	/// UserControl que permite somente input de endpoint
	/// </summary>
	public class EndPointTextBox : BaseSimpleTextBox
	{
		private EndPointTextBox()
		{
			this.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
			this.VerticalAlignment = System.Windows.VerticalAlignment.Center;
		}

		public EndPointTextBox(XmlTag tag) : this()
		{
			this.DataContext = tag;
			ConfigurationBinding bd = new ConfigurationBinding();
			this.SetBinding(EndPointTextBox.TextProperty, bd);
			this.IsRequired = tag.IsRequired;
		}

		public EndPointTextBox(RegistryValue reg) : this()
		{
			this.DataContext = reg;
			ConfigurationBinding bd = new ConfigurationBinding();
			this.SetBinding(EndPointTextBox.TextProperty, bd);
			this.IsRequired = reg.IsRequired;
		}

		public EndPointTextBox(XmlAttribute attribute) : this()
		{
			this.DataContext = attribute;
			ConfigurationBinding bd = new ConfigurationBinding();
			this.SetBinding(EndPointTextBox.TextProperty, bd);
			this.IsRequired = attribute.IsRequired;
		}
	}
}